/**
 * 
 */
package com.alex.hibernate.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.alex.basic.dao.hibernate.BasicDao;
import com.alex.hibernate.dao.UserDao;
import com.alex.hibernate.domain.User;

/**
 * @author alex
 */
@Repository
public class UserDaoHibernate extends BasicDao implements UserDao {
	
	public void save(User user) {
		super.save(user);
	}
	
	@SuppressWarnings("unchecked")
	public List<User> list() {
		return (List<User>)this.getSession().createCriteria(User.class).list();
	}

	public User load(String id) {
		return (User)this.getSession().load(User.class, id);
	}

	public User get(String id) {
		return (User)this.getSession().get(User.class, id);
	}

}
